/**
 * @file argsParser.h
 * @author SDK_TEAM
 * @brief 命令行参数解析示例
 * @version 0.1
 * @date 2022-10-26
 *
 * Copyright:
 * © 2018 北京灵汐科技有限公司 版权所有。
 * 注意：以下内容均为北京灵汐科技有限公司原创，未经本公司允许，不得转载，否则将视为侵权；对于不遵守此声明或者其他违法使用以下内容者，本公司依法保留追究权。
 * © 2018 Lynxi Technologies Co., Ltd. All rights reserved.
 * NOTICE: All information contained here is, and remains the property of Lynxi.
 * This file can not be copied or distributed without the permission of Lynxi
 * Technologies Co., Ltd.
 *
 */
#pragma once

#include <iostream>
#include <string>
#include "CLI/CLI11.hpp"
#include "util.hpp"

namespace ArgsParse
{

  bool yolov5ArgsParser(int argc, char *argv[])
  {
    CLI::App app;

    std::string argChips;
    int showType = 1;

    app.add_option("inputFile", argInputFilePath, "input image file path")->default_val("../data/opencv_yolov5_detect_with_image_sample/test.JPEG");
    app.add_option("-m,--modelPath", argModelPath, "yolov5s model path")->default_val("../model/yolov5s_b1_h640_w640_c3_iuint8_ofloat16_0000_quant/Net_0");
    app.add_option("-p,--postPlugPath", argPostPluginPath, "yolov5s post process plugin path")->default_val("../common/plugin/postprocess/cross_compiled_lib/libYolov5PostPlugin.so");
    app.add_option("-o,--osdPlugPath", argOsdPluginPath, "osd process plugin path")->default_val("../common/plugin/osd/lib/libOsdPlugin.so");
    app.add_option("-d,--device_id", argChips, "test device number which can be 0~N-1 (N is device count), eg.:0,1,2")->default_val("0");
    app.add_option("-c,--channelCount", argChannel, "process channel count")->default_val(1);
    app.add_option("-s,--showType", showType, "0: show test file directly, 1: save test result to be a file")->default_val(1);

    CLI11_PARSE(app, argc, argv);

    // 在这里可以添加参数验证逻辑
    if (!setChips(argChips.c_str(), ','))
    {
      return false;
    }

    setShowType(showType);
    return true;
  }

} // namespace ArgsParse
